package cn.com.bluemoon.daps.sync.vo.syncmanage;

import cn.com.bluemoon.daps.common.enums.SyncStatus;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author Jarod.Kong
 * @date 2021/7/2 10:03
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel(description = "同步管理-同步详情-列表信息")
public class SyncEnvInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "模型id")
    private String modelId;

    @ApiModelProperty(value = "任务明细id")
    private String taskDetailId;

    @ApiModelProperty(value = "环境id, 3:预发布 4：生产", example = "3")
    private Integer envCodeId;

    @ApiModelProperty(value = "主机", example = "127.0.0.1")
    private String host;

    @ApiModelProperty(value = "端口", example = "3306")
    private Integer port;

    @ApiModelProperty(value = "Schema", example = "dap_db")
    private String schema;

    @ApiModelProperty(value = "数据库名", example = "dap_db")
    private String dbname;

    @ApiModelProperty(
            value = "同步状态： SYNC_WAIT 未同步、 SYNC_DOING 同步中、 SYNC_DONE 已同步、 SYNC_ERROR 同步失败、SYNC_ALL 同步全部 （全字母必须大写）",
            example = "SYNC_ALL")
    private SyncStatus syncStatus;

    @ApiModelProperty(value = "执行人", example = "80560490")
    private String syncBy;

    @ApiModelProperty(value = "DBA", example = "80560490")
    private String dbaManageBy;

    @ApiModelProperty(value = "执行时间", example = "1970-01-01 00:00:00")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private LocalDateTime syncTime;
}
